import React, { useEffect, useState } from 'react';
import {$getFollowList} from "../../api/starapi";
import Followlist from "../../components/followlist/followlist";
const Star=()=>{
    //关注列表的数据
    const [followlists,setFollowLists]=useState([]);
    //获取关注列表
    const getFollowList=async ()=>{
        const response =await $getFollowList();
        setFollowLists(response.data);
    }
useEffect(()=>{
getFollowList();//获取关注列表
},[])
//显示关注用户
    return(
        <div>
            <div style={{marginBottom:'20px'}}>全部关注</div>
            {followlists.map((item, index) => (
                <Followlist key={index} item={item} />
            ))}
        </div>
    )
}
export default Star;